/**
 * 
 */
package com.dsteiner.widgets.server;

import java.util.Date;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.dsteiner.widgets.client.domain.Distinctable;
import com.dsteiner.widgets.client.domain.DistinctableProperty;
import com.dsteiner.widgets.client.domain.ModelObject;
import com.dsteiner.widgets.client.domain.Searchable;
import com.dsteiner.widgets.client.domain.SearchableId;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
@Searchable
@Distinctable
public class ModelObjectMock extends ModelObject{
	@DistinctableProperty
	@Persistent
	private String name;
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    @SearchableId
	private String id;
	
	public ModelObjectMock(String name) {
		this.name = name;
	}
	public ModelObjectMock() {
	}
	@Override
	public String getId() {
		return id;
	}
	public String getName(){
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public Date getRegisteredDate() {
		return new Date();
	}
	@Override
	public void setId(String id) {
		this.id = id;
	}
	@Override
	public String toString() {
		return name;
	}
}